<?php

function smarty_modifier_clean($string)
{
	/*
	preg_match_all("/<!--([^>]*)-->/", $string, $comments);
	print_r($comments);
	if(isset($comments[0])) {
		foreach($comments[0] as $comment) {
			$string = str_replace($comment, "", $string);
		}
	}*/
	
	preg_match_all("/<img\s([^>]*)>/", $string, $imgs);
	if(!empty($imgs[0])) {
		foreach($imgs[0] as $img) {
			$string = str_replace($img, md5($img), $string);
		}
	}
	$string = preg_replace('!<[^>]*?>!', '', $string);

	if(!empty($imgs[0])) {
		foreach($imgs[0] as $img) {
			$string = str_replace(md5($img), $img, $string);
		}
	}
	
	return $string;
}

/* vim: set expandtab: */

?>
